﻿@model Shop.User.Models.UsersInfo
@{
    //个人信息
    ViewBag.Title = "个人信息";
    Layout = "~/Views/Home/_HomeLayout.cshtml";
}
@section Head{
    <style type="text/css">
        .dept_select {
            min-width: 200px;
        }

        .ui-sortable .panel-header {
            cursor: move
        }
    </style>
    <link rel="stylesheet" type="text/css" href="~/Content/Home/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/Home/css/iconfont.min.css" />
}
<div class="container" ui-sortable>
    <div class="row clearfix">
        <div class="col-md-2 column">
            <div class="panel-group">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <a class="panel-title" data-toggle="collapse" href="#son1">账号管理</a>
                    </div>
                    <div id="son1" class="panel-collapse in">
                        @*collapse默认关闭*@
                        <div class="panel-body">
                            <div class="bs-example" data-example-id="vertical-button-group">
                                <div class="btn-group-vertical" role="group" aria-label="Vertical button group">
                                    <a href="@Url.Action("UpdateUserInfo", "Home")" class="btn btn-link">修改个人信息</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <a class="panel-title" data-toggle="collapse" href="#son2">购物管理</a>
                    </div>
                    <div id="son2" class="panel-collapse in">
                        <div class="panel-body">
                            <div class="bs-example" data-example-id="vertical-button-group">
                                <div class="btn-group-vertical" role="group" aria-label="Vertical button group">
                                    <a href="@Url.Action("ShopCar", "Home")" class="btn btn-link">购物车管理</a>
                                    <a href="@Url.Action("UserOrder", "Home")" class="btn btn-link">订单管理</a>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-6 column" style="margin-top:10px;font-weight:600">
            <div class="panel panel-default">
                <div class="panel-body">
                    <form action="" method="post" class="form form-horizontal responsive" id="demoform">

                        <div class="row cl">
                            <label class="form-label col-xs-3">用户名：</label>
                            <div class="formControls col-xs-8">
                                <input type="text" class="input-text" name="UName" id="UName" value="@Model.UName" readonly>
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-xs-3">手机：</label>
                            <div class="formControls col-xs-8">
                                <input type="text" class="input-text" autocomplete="off" placeholder="手机" name="Tel" id="Tel" value="@Model.Tel" readonly>
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-xs-3">密码：</label>
                            <div class="formControls col-xs-8">
                                <input type="password" class="input-text" autocomplete="off" placeholder="密码" name="UPass" id="UPass" value="@Model.UPass" readonly>
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-xs-3">邮箱：</label>
                            <div class="formControls col-xs-8">
                                <input type="text" class="input-text" autocomplete="off" placeholder="邮箱" name="Email" id="Email" value="@Model.Email" readonly>
                            </div>
                        </div>
                        <div class="row cl">
                            @{var sexname = "";}
                            @if (@Model.Sex == 1)
                            {
                                sexname = "男";
                            }
                            else
                            {
                                sexname = "女";
                            }

                            <label class="form-label col-xs-3">性别：</label>
                            <div class="formControls col-xs-8">
                                <input type="text" class="input-text" autocomplete="off" placeholder="性别" name="Sex" id="Sex" value="@sexname" readonly>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </div>
</div>
<script type="text/javascript">
    //删除购物车中的东西
    function delshopcar(BCID) {
        var gnl = confirm("确定要删除吗?");
        if (gnl == true) {
            $.ajax({
                url: '@Url.Action("DelShopCar")',
                type: 'post',
                dataType: 'text',
                data: { BCID: BCID },
                async: false,
                success: function (data) {
                    if (data == 'NO') {
                        alert("删除失败");
                    }
                    if (data == "User")
                    {
                        alert("无效的用户状态，请重新登陆");
                        location.href = "@Url.Action("UsersLogin","User")";
                    }
                    else {
                        showcar();
                        HomeShopCar();
                    }
                },
                error: function () {
                    alert("Ajax调用出错请与管理员联系");
                }
            });
        }

    }
    function showcar()
    {
        $.ajax({
            cache: false,
            type: 'post',
            url: '@Url.Action("_ShopCar")',
            dataType: 'text',
            success: function (data) {
                $("#Car").html(data);
            },
            error: function () {
                alert("Ajax调用出错请与管理员联系");
            }
        });
    }
</script>